package com.share.rule.api;

import com.share.common.core.constant.ServiceNameConstants;

import com.share.common.core.domain.R;
import com.share.rule.domain.FeeRule;
import com.share.rule.domain.FeeRuleRequestForm;
import com.share.rule.domain.FeeRuleResponseVo;
import com.share.rule.factory.RemoteFeeRuleFallbackFactory;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;


/**
 * 用户服务
 *
 * @author share
 */
@FeignClient(contextId = "remoteFeeRuleService", value = ServiceNameConstants.SHARE_RULE, fallbackFactory = RemoteFeeRuleFallbackFactory.class)
public interface RemoteFeeRuleService {

    /** 批量获取全部费用规则 */
    @PostMapping(value = "/feeRuleApi/getFeeRuleList")
    public R<List<FeeRule>> getFeeRuleList(@RequestBody List<Long> feeRuleIdList);

    /** 获取费用规则详细信息*/
    @GetMapping(value = "/feeRuleApi/getFeeRule/{id}")
    public R<FeeRule> getFeeRule(@PathVariable("id") Long id);

    /** 计算订单费用 */
    @PostMapping(value = "/feeRuleApi/calculateOrderFee")
    public R<FeeRuleResponseVo> calculateOrderFee(@RequestBody FeeRuleRequestForm feeRuleRequestForm);

}
